package com.hsh.maoduo.pojo.dto;

import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import org.apache.logging.log4j.util.Strings;

@Data
public class ShopGoodsDTO {

    /**
     *
     */
    @TableId
    private Integer id;

    /**
     *
     */
    private String shopGoodsId;

    /**
     *
     */
    private Integer shopId;

    /**
     *
     */
    private String shopName;

    /**
     *
     */
    private Integer goodsId;

    /**
     *
     */
    private String goodsInfo;

    /**
     *
     */
    private Integer num;

    /**
     *
     */
    private String goodsName;

    /**
     *
     */
    private String simpleGoodsName;

    /**
     *
     */
    private String note;

    /**
     * 重量：g
     */
    private Integer weight;

    public ShopGoodsDTO init() {
        if (Strings.isNotBlank(this.simpleGoodsName)) {
            this.goodsInfo = this.simpleGoodsName + "*" + this.num;
            return this;
        }
        if (Strings.isNotBlank(this.goodsName)) {
            this.goodsInfo = this.goodsName + "*" + this.num;
            return this;
        }
        return this;
    }
}
